<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>角色列表</title>
    <#include "/layout/css.html"/>
</head>
<body class="body">

<!-- 工具集 -->
<hr>
<!-- 表格 -->
<form class="layui-form" action="" id="formId"  onsubmit="return false">
	<div class="layui-form-item"  >
		<#list roleListData as x>
		 	<div class="layui-input-inline" style="width:333px;margin: 15px;">
				<input type="checkbox" lay-filter="filter" value="${x.sysRoleId!}" name="like[write]" title="${x.name!}" 
				<#list userRoleListData as x1>
					<#if x.sysRoleId == x1.sysRoleId> checked
					</#if>
				</#list>
				/>
			</div>
		</#list>
	</div>
</form>
<#include "/layout/js.html"/>
<script type="text/javascript">
    // layui方法
    layui.use(['table', 'form', 'layer', 'vip_table'], function () {
        // 操作对象
        var form = layui.form
                , table = layui.table
                , layer = layui.layer
                , vipTable = layui.vip_table
                , $ = layui.jquery;
        var table = layui.table;
        form.on('checkbox(filter)', function(data){
        	  console.log(data.elem); //得到checkbox原始DOM对象
        	  console.log(data.elem.checked); //是否被选中，true或者false
        	  console.log(data.value); //复选框value值，也可以通过data.elem.value得到
        	  console.log(data.othis); //得到美化后的DOM对象
//         	  addOrDelData
			  showLoading();
			  authManagerHttp({url:"/role/addOrDelData",data:{"userId":"${userId!}","sysRoleId":data.value}},{all:function(){
				  location.reload();
// 				  hideLoading();
			  }})
        	  
        });      
        
    });
</script>
</body>
</html>